﻿using UnityEngine;

namespace Inlycat
{
    /// <summary>
    /// 状态基类
    /// </summary>
    /// <typeparam name="T">实体类型</typeparam>
    public class State<T>
    {
        /// <summary>
        /// 进入状态
        /// </summary>
        /// <param name="entity">实体</param>
        public virtual void Enter(T entity) { }
        /// <summary>
        /// 执行状态
        /// </summary>
        /// <param name="entity">实体</param>
        /// <param name="deltaTime">时间增量</param>
        public virtual void Execute(T entity, float deltaTime) { Debug.Log(string.Format("State<T>.Execute({0})", entity)); }
        /// <summary>
        /// 退出状态
        /// </summary>
        /// <param name="entity">实体</param>
        public virtual void Exit(T entity) { }
        /// <summary>
        /// 接收消息
        /// </summary>
        /// <param name="telegram">消息数据</param>
        /// <returns></returns>
        public virtual bool OnMessage(Telegram telegram) { return false; }
    }
}